/*
 * --------------------------------------------------------------
 * Copyright ©  2015 Hangzhou DtDream Technologies Co.,Ltd.
 * --------------------------------------------------------------
 *      Product: 协同数治
 *  Module Name: design
 * Date Created: 2023/2/23
 *  Description: TODO
 * --------------------------------------------------------------
 * Modification History
 * DATE            NAME            Description
 * --------------------------------------------------------------
 * 2023/2/23       yewj            TODO
 * --------------------------------------------------------------
 */

package com.dtdream.pattern.command;

/**
 * TODO
 *
 * @Author: yewj
 **/
public class Client {
    public static void main(String[] args) {
        LightReceive lightReceive = new LightReceive();

        LightOnCommand lightOnCommand = new LightOnCommand(lightReceive);
        LightOffCommand lightOffCommand = new LightOffCommand(lightReceive);

        RemoteController remoteController = new RemoteController();
        remoteController.setCommand(0, lightOnCommand, lightOffCommand);

        System.out.println("--------按下灯的开的按钮-----------");
        remoteController.onButtonWasPushed(0);
        System.out.println("--------按下灯的关的按钮-----------");
        remoteController.offButtonWasPushed(0);
        System.out.println("--------按下灯的撤销的按钮-----------");
        remoteController.undoButtonWasPushed();
    }
}
